//package com.corpgovernment.organization.util;
//
//import com.actionsoft.bpms.api.OpenApiClient;
//import com.actionsoft.sdk.service.response.ListMapResponse;
//import com.corpgovernment.organization.config.OrgClientConfig;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//import java.util.concurrent.Callable;
//
///**
// * @ClassName: SunCallable
// * @description: TODO
// * @author: zdwang
// * @date: Created in 19:42 2019/7/22
// * @Version: 1.0
// **/
//public class SunCallable implements Callable<List<Map<String, Object>>> {
//    private final String GET_USERS_BYDPID = "org.users.get.department";
//    //当前是属于第几段线程
//    private int pageIndex;
//    private List<String> list;
//    private OrgClientConfig config;
//
//    public SunCallable(int pageIndex, List<String> list,OrgClientConfig config) {
//        this.pageIndex = pageIndex;
//        this.list = list;
//        this.config = config;
//    }
//
//    @Override
//    public List<Map<String, Object>> call() throws Exception {
//        OpenApiClient client = config.getClient();
//        List<Map<String, Object>> result = new ArrayList<>();
//        if (null != list && list.size() > 0) {
//            for (String deptId : list) {
//                try {
//                    Map param = new HashMap<>();
//                    param.put("departmentId", deptId);
//                    ListMapResponse r = client.exec(GET_USERS_BYDPID, param, ListMapResponse.class);
//                    List<Map<String, Object>> data = r.getData();
//                    result.addAll(data);
//                } catch (Exception e) {
//                    result = new ArrayList<>();
//
//                }
//            }
//        }
//        return result;
//    }
//}